package org.nutboat.core;

public abstract class GameSystem {

	private boolean running;
	
	public boolean isRunning() {
		return running;
	}
	
	public void startup() {
		if (!running) {
			onStartup();
			running = true;
		}
	}
	
	protected abstract void onStartup();
	
	public void shutdown() {
		if (running) {
			onShutdown();
			running = false;
		}
	}
	
	protected abstract void onShutdown();
	
	public void update() {
		if (running) {
			onUpdate();
		}
	}
	
	protected abstract void onUpdate();
}
